
<template>
  <div class="main-container">
    <div class="filtrate-bar">
      <div class="title-box">
        <div class="icon-box">
          <span class="wk wk-my-task icon" />
        </div>
        <span class="text">碰撞客户报告</span>
      </div>
    </div>

    <div class="content">
      <div class="table-content">
        <div class="handle-bar">
          <!--
          <a-button class="export-btn" type="primary" icon="download" @click="handleExportXls">导出</a-button>
          -->
        </div>
        <a-table
          :columns="columns"
          :data-source="dataList"
          :pagination="{ pageSize: 20 }"
          :scroll="{ y: 550 }"
          bordered
        >
          <template slot="id" slot-scope="text, record">
            <a-tooltip placement="top">
              <template slot="title">
                <span>{{ record.id }}</span>
              </template>
              <span class="ellipsis" style="text-align: center; width: 100%"
                ><a @click="() => checkShow(record.collideList)">{{ record.id }}</a></span
              >
            </a-tooltip>
          </template>
        </a-table>
      </div>
    </div>

    <customer-list ref="checkModel"></customer-list>
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { postAction, getAction, downFile } from '@/api/manage'
import CustomerList from './components/CustomerList'
import * as echarts from 'echarts'
export default {
  name: 'statistics',
  mixins: [JeecgListMixin],
  components: {
      CustomerList
  },
  data() {
    return {
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 100,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '碰撞内容',
          align: 'center',
          dataIndex: 'id',
          scopedSlots: { customRender: 'id' },
        },
        {
          title: '碰撞次数',
          align: 'center',
          dataIndex: 'collideNum',
        },
      ],
      dataList: [],
      url: {
        list: '/online/api/',
        collideCustomerName: '/online/api/collideCustomerName',
        exportXlsUrl: '/online/api/export/exportXlsGraphReport',
      },
    }
  },
  computed: {},
  //watch: {},
  mounted() {
    this.getDataList()
  },
  methods: {
    getDataList() {
      const param = {}
      param.pageSize = 100
      getAction(this.url.collideCustomerName, param).then((res) => {
        if (res.success) {
          this.dataList = res.result.collideList
        }
      })
    },

    /**
     * 导出点击
     */
    exportClick() {
      this.requestExportInfo(biCustomerTotalListExportAPI, this.listPostParams)
    },
    handleType() {},
    checkShow(data) {
      this.$refs.checkModel.show(data)
    },
  },
}
</script>


<style lang="less" scoped>
.main-container {
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  background-color: white;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.filtrate-bar {
  background-color: white;
  padding: 15px 20px 5px 20px;
  margin-right: 15px;
  line-height: 34px;
  .icon-box {
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 34px;
    color: #168a40;
    background-color: #dfe8ff;
    border-radius: 50%;
    margin-right: 10px;
    float: left;
  }
  .text {
    font-size: 17px;
    font-weight: 700;
  }
}

.content {
  height: calc(100% - 54px);
  overflow-y: auto;
  padding: 10px 0;
}

.content-title {
  padding: 10px 20px 5px;
  font-size: 16px;
  color: #333;
}

.axis-content {
  padding: 20px 10% 40px;
  position: relative;
  .axismain,
  #axismain {
    margin: 0 auto;
    width: 95%;
    height: 400px;
  }
}

.table-content {
  padding: 0 60px 20px 60px;
}

.export-button {
  float: right;
  margin-right: 22px;
}

// 导出操作bug
.handle-bar {
  margin-bottom: 8px;
  text-align: right;
}

.search-box {
  padding-right: 15px;
}

.radio-box {
  padding: 0 20px;
  margin-bottom: 15px;
  /deep/ .el-radio__label {
    color: #99a9bf !important;
  }
}

.static {
  padding: 0 20px;
  margin-bottom: 10px;
  .text {
    font-size: 13px;
    color: #99a9bf;
    display: inline-block;
  }
  .text:not(:last-child) {
    margin-right: 15px;
  }
}
</style>

